#include "function_layer/CountDisplay.h"
#include "function_layer/Display.h"
#include "implement_layer/StringDisplayImpl.h"
#include <new>

int main()
{
    ImplLayer::StringDisplayImpl s1("Hello, China.");
    ImplLayer::StringDisplayImpl s2("Hello, World.");
    ImplLayer::StringDisplayImpl s3("Hello, Universe.");

    /* this block shows every class in function layer can make a bridge to classes
     * in impl layer */
    FuncLayer::Display d1(&s1);
    FuncLayer::Display *pd2 = new FuncLayer::CountDisplay(&s2);
    FuncLayer::CountDisplay d3(&s3);

    d1.display();
    pd2->display();
    d3.display();
    d3.multiDisplay(5);

    delete pd2;
    return 0;
}
